{include admin.inc.header}

{include admin.inc.top}

<div class="container-fluid content-body">
	<div class="main">
		{include admin.inc.menu}

		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">
				<ul class="breadcrumb">
					<li>
						<i class="glyphicon glyphicon-home"></i>
						<span>当前位置：</span>
						<a href="#">{$breadcrumb[0]}</a>
						<i class="glyphicon glyphicon-chevron-right"></i>
						<a href="#">{$breadcrumb[1]}</a>
					</li>
				</ul>

				<!-- Nav tabs -->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">
					<li><a href="{$add_url}"><i class="glyphicon glyphicon-plus"></i> 会员注册</a></li>
					<li><a href="{$index_url}"><i class="glyphicon glyphicon-th-list"></i> 会员列表</a></li>
					<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-edit"></i> 会员编辑</a></li>
				</ul>

				<div class="inner-container">

					<!-- Nav tabs -->
					<ul class="nav nav-tabs" role="tablist" id="myTab">
						<li role="presentation"><a href="#account" role="tab" data-toggle="tab">账户信息</a></li>
						<li role="presentation"><a href="#company" role="tab" data-toggle="tab">企业信息</a></li>
						<li role="presentation"><a href="#trade" role="tab" data-toggle="tab">交易信息</a></li>
					</ul>

					<form role="form" class="content-add-form form-horizontal" id="content-add-form" autocomplete="off">
						<!-- Tab panes -->
						<div class="tab-content" style="padding-top: 20px;">
							<!-- 账户信息 -->
							<div role="tabpanel" class="tab-pane fade" id="account">

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 手机号码</label>
									<div class="col-sm-10">
										<input type="text" dtype="mobile" class="form-control" value="{$item[username]}" maxlength="11" disabled/>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 联系人</label>
									<div class="col-sm-10">
										<input type="text" name="data[contacter]" value="{$item[contacter]}" class="form-control" min-length="2" maxlength="15" placeholder="联系人" required />
										<p class="help-block">至少两个字符</p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 性别</label>
									<div class="col-sm-10">
										<div>
											<label class="icheck-label"><input type="radio" name="data[sex]" value="0" class="icheck" {if $item[sex]==0}checked{/if}> 先生</label>
											<label class="icheck-label"><input type="radio" name="data[sex]" value="1" class="icheck" {if $item[sex]==1}checked{/if}> 女士</label>
										</div>
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label">邮箱</label>
									<div class="col-sm-10">
										<input type="text" name="data[email]" value="{$item[email]}" maxlength="50" class="form-control" placeholder="邮箱" />
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label">QQ</label>
									<div class="col-sm-10">
										<input type="text" name="data[qq]" value="{$item[qq]}" class="form-control" maxlength="20" placeholder="QQ" />
										<p class="help-block"></p>
									</div>
								</div>

							</div><!-- END账户信息 -->

							<!-- 企业信息 -->
							<div role="tabpanel" class="tab-pane fade" id="company">

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 公司名称</label>
									<div class="col-sm-10">
										<input type="text" name="company[company]" value="{$company[company]}" maxlength="20" class="form-control" placeholder="公司名称" required {if $item[ischecked]==2}disabled{/if} />
										<input type="hidden" name="company_bak" value="{$company[company]}">
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 地址</label>
									<div class="col-sm-10">
										<div id="area-select-box" class="form-inline area-select"></div>
										<input type="text" name="company[address]" value="{$company[address]}" maxlength="20" class="form-control" placeholder="街道地址" required />
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label">邮政编码</label>
									<div class="col-sm-10">
										<input type="text" name="company[zipcode]" value="{$company[zipcode]}" maxlength="6" class="form-control" placeholder="邮政编码" />
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label">注册资金</label>
									<div class="col-sm-10">
										<input type="text" name="company[register_capital]" dtype="float" maxlength="20" value="{$company[register_capital]}" class="form-control" placeholder="注册资金" />
										<p class="help-block">最多保留2位小数，单位万元</p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 企业类别</label>
									<div class="col-sm-10">
										<div class="checkbox-group">
											<label class="icheck-label"><input type="radio" name="company[type]" value="1" class="icheck" {if $company[type]==1}checked{/if}> 原料生产企业</label>
											<label class="icheck-label"><input type="radio" name="company[type]" value="2" class="icheck" {if $company[type]==2}checked{/if}> 原料代理/贸易商家</label>
											<label class="icheck-label"><input type="radio" name="company[type]" value="3" class="icheck" {if $company[type]==3}checked{/if}> 下游生产工厂</label>
										</div>
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 主营行业</label>
									<div class="col-sm-10">
										<div class="checkbox-group">
											{loop $appConfigs[company_main_business] $key $value}
											<label class="icheck-label">
												<input type="checkbox" name="main_business[]" min-check="1" cname="主营行业" class="icheck" {if in_array($key, $company[main_business])}checked{/if} value="{$key}" required>
												{$value}</label>
											{/loop}
										</div>
										<p class="help-block"></p>
									</div>
								</div>

							</div><!-- END 企业信息 -->

							<!-- 交易信息 -->
							<div role="tabpanel" class="tab-pane fade" id="trade">

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 法定代表人</label>
									<div class="col-sm-10">
										<input type="text" name="company[legal_person]" value="{$company[legal_person]}" maxlength="20" class="form-control" placeholder="法定代表人" required />
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 法定代表人手机</label>
									<div class="col-sm-10">
										<input type="text" name="company[mobile]" value="{$company[mobile]}" dtype="mobile"  class="form-control" placeholder="法定代表人手机" required />
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 法人身份证</label>
									<div class="col-sm-10">
										<div class="form-inline">
											<input type="text" name="company[idcard_no]" value="{$company[idcard_no]}" dtype="idnum"  class="form-control" placeholder="法人身份证" required />
											<span class="icon-group">
												<i class="glyphicon glyphicon-open jupload" title="上传"></i>
												<input type="hidden" name="company[idcard_positive]" empty-message="请上传身份证正面" value="{$company[idcard_positive]}" required>
												<i class="glyphicon glyphicon-picture img-view" data-src="{$company[idcard_positive]}" title="预览"></i>
												<span style="margin-right: 20px; margin-left: 10px;">正面照</span>
												<i class="glyphicon glyphicon-open jupload" title="上传"></i>
												<input type="hidden" name="company[idcard_opposite]" empty-message="请上传身份证背面" value="{$company[idcard_opposite]}" required>
												<i class="glyphicon glyphicon-picture img-view" data-src="{$company[idcard_opposite]}" title="预览"></i>
												<span style="margin-right: 20px; margin-left: 10px;">背面照</span>
											</span>

										</div>
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 证书</label>
									<div class="col-sm-10">
										<div>
											<label class="icheck-label"><input type="radio" name="company[three_in_one]" value="0" class="icheck" {if $company[three_in_one]==0}checked{/if}> 企业三证</label>
											<label class="icheck-label"><input type="radio" name="company[three_in_one]" value="1" class="icheck" {if $company[three_in_one]==1}checked{/if} id="three_in_one"> 三证合一</label>
										</div>
										<p class="help-block"></p>
									</div>
								</div>


								<div class="form-group">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 营业执照</label>
									<div class="col-sm-10">
										<div class="form-inline">
											<input type="text" name="company[license]" maxlength="20" value="{$company[license]}" class="form-control" placeholder="营业执照" required />
											<span class="icon-group">
												<i class="glyphicon glyphicon-open jupload" title="上传"></i>
												<input type="hidden" name="company[license_pic]" empty-message="请上传营业执照" value="{$company[license_pic]}" required>
												<i class="glyphicon glyphicon-picture img-view" data-src="{$company[license_pic]}" title="预览"></i>
											</span>

										</div>
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group" {if $company[three_in_one]==1}style="display: none"{/if} id="taxno">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 税务登记号</label>
									<div class="col-sm-10">
										<div class="form-inline">
											<input type="text" name="company[taxno]" value="{$company[taxno]}" maxlength="20"  class="form-control" placeholder="税务登记号" {if $company[three_in_one]==0}required{/if} />
											<span class="icon-group">
												<i class="glyphicon glyphicon-open jupload" title="上传"></i>
												<input type="hidden" name="company[taxno_pic]" empty-message="请上传税务登记证明" value="{$company[taxno_pic]}" {if $company[three_in_one]==0}required{/if}>
												<i class="glyphicon glyphicon-picture img-view" data-src="{$company[taxno_pic]}" title="预览"></i>
											</span>

										</div>
										<p class="help-block"></p>
									</div>
								</div>

								<div class="form-group" {if $company[three_in_one]==1}style="display: none"{/if} id="orgcode">
									<label class="col-sm-2 control-label"><span class="asterisk">*</span> 组织机构代码证</label>
									<div class="col-sm-10">
										<div class="form-inline">
											<input type="text" name="company[orgcode]" value="{$company[orgcode]}" maxlength="20"  class="form-control" placeholder="组织机构代码证" {if $company[three_in_one]==0}required{/if} />
											<span class="icon-group">
												<i class="glyphicon glyphicon-open jupload" title="上传"></i>
												<input type="hidden" name="company[orgcode_pic]" empty-message="请上传组织机构代码证" value="{$company[orgcode_pic]}" {if $company[three_in_one]==0}required{/if}>
												<i class="glyphicon glyphicon-picture img-view" data-src="{$company[orgcode_pic]}" title="预览"></i>
											</span>

										</div>
										<p class="help-block"></p>
									</div>
								</div>

							</div><!-- END 交易信息 -->

						</div><!-- END panel -->

						<input type="hidden" name="id" value="{$item[id]}">

						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10">
								<div class="btn-group btn-group-or">
									<a href="{$update_url}" class="btn btn-primary ajaxproxy"
									   proxy='{"method":"post", "location":"{$index_url}"}'>提交保存</a>
									<span class="or">OR</span>
									<button type="reset" class="btn btn-default">重置表单</button>
								</div>
							</div>
						</div>

					</form>

				</div><!-- end of inner container -->

			</div><!-- end of inner frame-->

		</section>

	</div>
</div>

{include admin.inc.footer}

<script>
	seajs.use("user", function(exports) {
		exports.init({
			prov : '{$company[prov]}',
			city : '{$company[city]}',
			dist : '{$company[dist]}',
		});
		exports.upload();
	});
</script>
</body>
</html>
